﻿<?php require_once(dirname(__FILE__)."/../config/config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

</head>
<body>
<?php  
if($_SESSION['admin_name']=="")
{

	echo "<script>location.href='admin_login.php';</script>";
}
?>
<?php
	$shop_id=$_GET['id'];
	$sql = "select * from zy_user where shop_id= '".$shop_id."'";
	$result = mysql_query($sql);
	$user = mysql_fetch_array($result);
?>
<h1 align="center">店铺管理员账号修改</h1>
<form id="form1" name="form1" method="post" action="" >
	<div align="center">Email：
	  <input name="mail" type="text" id="mail" value="<?php echo $user["mail"];?>"/>
	</div>
	<p align="center">
	密码：<input name="password" type="text" id="password" value="<?php echo $user["password"];?>"/><p align="center">
	昵称：<input name="username" type="text" id="username" value="<?php echo $user["username"];?>"/><p align="center">
	<input name="submit" type="submit"  value="修改"/>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="admin_management.php">返回</a>
</form>
<?php
	if(!empty($_POST['submit'])){
		$username=$_POST['username'];
		$password=$_POST['password'];
		$mail=$_POST['mail'];
		if($username!="" && $password!="" && $mail!=""){
		$sql1="update zy_user set username='".$username."',password='".$password."',mail='".$mail."' where shop_id='".$shop_id."'";
		mysql_query($sql1);
		echo "<script>location.href='admin_management.php';</script>";
		}else{
			echo "账号、密码、邮箱不能为空";
		}
	}
?>
</body>
</html>
